-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workaround for type inference problem in index_sizes
#139
Conversation
Ah, just after (of course!) submitting the PR, I realized two things:
|
Fixed the the case for |
Thanks for working on this! I'm on vacation for another week, so I can't have an in depth look at the moment. I can say I'm very happy this is being looked at. I assume someone has (or will) check the generated code? Other than that, I think I'm ok with this PR. |
I don't think I'm sufficiently familiar with this package to check the generated code. I've done some very basic benchmarking of indexing: sm = @SMatrix [1 2 3; 4 5 6]
sv = @SVector [1, 2]
@benchmark $sm[$sv, 1]
@benchmark $sm[1, $sv]
@benchmark $sm[:, $sv]
@benchmark $sm[$sv, :]
@benchmark $sm[1, :]
@benchmark $sm[1, 1]
@benchmark $sm[:, 1]
@benchmark $sm[:, :] They are all within measurement between master and this PR. I've also checked |
Thanks for tackling this one. It's very pleasing that your new implementation avoids any mention of Regarding your @testset "blah" begin
# ... lots of other tests ...
# Now the test which needs a custom type
@eval struct Foo
i::Int
end
# Some test using Foo
@test Foo(1).i == 1
end Of course the type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spent a while looking at this (some benchmarking and reading various pieces of assembly). It seems to function perfectly as far as I can tell.
So I'll probably merge this tomorrow. @martinholters - did you want to add that other test case?
I don't think it would be worth the effort, so: no. If anyone disagrees, I'd be happy to add it, but not in the next couple of days. |
Sure no problems. I had a quick look but it seems to be obscure behavior which would be better as a compiler test. |
* allow failures on nightly * also test julia 1.5 * drop unsupported releases
Wokraround for JuliaLang/julia#21244.
I briefly tried adding a test case similar to the one from JuliaLang/julia#21244, but it seems to need the
struct Foo
which cannot be defined inside a@testset
. Is it worth to define such a type globally inruntests.jl
?